class P10918_39643 {

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}
	
	public static void main(String[] args) {
		int[] array = new int[31];
		array[0] = 1;
		array[2] = 3;
		array[4] = 11;
		array[6] = 41;
		array[8] = 153;
		array[10] = 571;
		array[12] = 2131;
		array[14] = 7953;
		array[16] = 29681;
		array[18] = 110771;
		array[20] = 413403;
		array[22] = 1542841;
		array[24] = 5757961;
		array[26] = 21489003;
		array[28] = 80198051;
		array[30] = 299303201;
		
		while (true) {
			int i = Integer.parseInt(readLn());
			if (i == -1)
				break;
			System.out.println(array[i]);
			
		}
		
	}

}
